[main] Fix quadtree leaf boundaries to match cuSpatial's clamped scale - #87
Open
Tobiaspk wants to merge 1 commit into
Open
[main] Fix quadtree leaf boundaries to match cuSpatial's clamped scale#87Tobiaspk wants to merge 1 commit into
Tobiaspk wants to merge 1 commit into
Conversation
get_quadtree_kwargs() computed scale without checking cuSpatial's own minimum-scale requirement, which cuSpatial silently clamps up to and only reports via a UserWarning. get_quadrant_bounds() then computed each leaf's polygon using the pre-clamp scale, so tile boundaries no longer matched the tree cuSpatial actually built. On the CosMx pancreas dataset this dropped ~50% of transcript points from every tile on the initial join, cascading into an all -1 label tensor and a bincount crash. Compute scale directly from cuSpatial's min-scale formula so it's never undershot, and pass the real (scale, max_depth) into get_quadrant_bounds so leaf polygons match the actual tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_quadrant_bounds()built leaf polygons assumingscale=1, but cuSpatial silently clamps scale higher oncemax_depthhits its cap of 15, so on datasets with large coordinate values (happened in a CosMx dataset) the tile boundaries stopped matching the tree cuSpatial actually built, dropping ~50% of points from every tile and crashingbincounton an all-1label tensor.Fix: compute
scalefrom cuSpatial's own min-scale formula so it's never undershot, and pass the real(scale, max_depth)intoget_quadrant_bounds.This fix worked for me on the CosMx pancreas dataset that crashed: 0/64,960,205
txand 0/47,488bdpoints unmatched, no appropriate warning.